<template>
	<view class="content" :style="theme">
		<view class="u-demo-block">
			<view class="u-demo-block__content">
				<u--form labelPosition="left" :model="model1" labelWidth="6em">
					<u-form-item label="反馈标题：" borderBottom>
						<u--input v-model="model1.title" border="none" placeholder="请输入反馈标题" maxlength="30">
						</u--input>
					</u-form-item>
					<u-form-item label="反馈内容：" borderBottom>
						<u--textarea v-model="model1.content" autoHeight border="none" placeholder="请输入反馈内容" maxlength="200" :customStyle="{background: 'none'}">
						</u--textarea>
					</u-form-item>
				</u--form>
				<view class="foot">
					<view class="foot_btn" @click="$noMultipleClicks(submit)">提交</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				noClick: true,
				model1: {}
			}
		},
		methods: {
			submit() {
				if (!this.model1.title) {
					this.$app.showToast('请输入反馈标题')
					return false
				}
				if (!this.model1.content) {
					this.$app.showToast('请输入反馈内容')
					return false
				}
				this.$app.ajax({
					data: {
						userId: this.userInfo.id,
						param: {
							title: this.model1.title,
							content: this.model1.content
						}
					},
					api: this.$api.feedback()
				}).then((res) => {
					if (res.errorCode == '000000') {
						this.$app.showToast('提交成功')
						setTimeout(() => {
							uni.navigateBack({
								delta: 1
							})
						}, 1000)
					}
				}).catch(() => {})
			},
		},
	}
</script>
<style lang="scss" scoped>
	.content {
		padding: 40rpx 40rpx 120rpx;
		box-sizing: border-box;
	}

	.foot {
		position: fixed;
		left: 30rpx;
		bottom: 30rpx;
		width: 690rpx;
		z-index: 999;

		.foot_btn {
			width: 690rpx;
			height: 88rpx;
			line-height: 88rpx;
			background: $color;
			text-align: center;
			font-size: 32rpx;
			border-radius: 10rpx;
			font-weight: 500;
			border: 1px solid $color;
			color: #FFFFFF;

			&.foot_btnb {
				background: #fff;
				color: $color;
				margin-top: 30rpx;
			}
		}

	}
</style>
